package org.flexharmony.harmonizer;

import static org.flexharmony.harmonizer.utils.CommonMethods.*;

public class QualifiedTypeName
{
  public final String packge;
  
  public final String name;

  public QualifiedTypeName(String packge, String name)
  {
    this.packge = packge;
    this.name = name;
  }
  
  public String toString()
  {
    if (packge == null)
    {
      return name;
    }
    else
    {
      return packge + "." + name;
    }
  }
  
  public boolean equals(Object obj)
  {
    if (obj instanceof QualifiedTypeName)
    {
      QualifiedTypeName qn = (QualifiedTypeName)obj;
      return nullEquals(packge, qn.packge) && nullEquals(name, qn.name);
    }
    else
    {
      return false;
    }
  }
  
  public int hashCode()
  {
    return toString().hashCode();
  }
}
